﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;

namespace Gerencial_Fisio_Nutry
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Variaveis.Variaveis.cod_Funcionario = -1;
            StreamReader sr;
            try
            {
                sr = File.OpenText(Environment.CurrentDirectory + "\\configuracao.txt");
                string input = null;
                while ((input = sr.ReadLine()) != null)
                    Variaveis.Variaveis.conexao = input;
            }
            catch
            {
                MessageBox.Show("Conexao Com banco inconsistente - Entre em contato com o suporte", "Mensagem");
            }
         //  Variaveis.Variaveis.conexao = " server=Localhost;Port=5432;User=postgres;Password=fof0130407*;Database=fisiosimao";
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Login(Environment.CurrentDirectory));
            if (Variaveis.Variaveis.cod_Funcionario != -1)
                Application.Run(new Tela.Principal());
        }
    }
}
